package a.f.d;

import a.c.k;
import a.c.w;
import a.c.x;
import a.c.y;
import a.f.ad;
import a.f.bd;
import a.f.cb;
import a.f.d.a.d;
import a.f.d.a.dc;
import a.f.d.a.fc;
import a.f.d.a.g;
import a.f.d.a.gc;
import a.f.d.a.h;
import a.f.d.a.hc;
import a.f.d.a.i;
import a.f.d.a.kc;
import a.f.d.a.r;
import a.f.d.a.sc;
import a.f.d.a.tc;
import a.f.d.a.v;
import a.f.d.a.xb;
import a.f.d.a.zb;
import a.f.ed;
import a.f.*;
import a.f.mb;
import a.f.pc;

import java.util.Comparator;
import java.util.HashMap;

import a.f.d.p;
import a.f.d.pb;
import a.f.d.ab;
import a.c.x;
import a.c.w;
import a.f.d.ob;

public class e
  extends mb
{
  public static final Object w = "y.layout.IncrementalHierarchicLayouter.STRAIGHT_EDGES_DPKEY";
  public static final Object x = d.E;
  public static final Object y = d.I;
  public static final Object z = d.J;
  public static final Object A = "y.layout.hierarchic.incremental.HierarchicLayouter.SWIMLANE_DESCRIPTOR_DPKEY";
  public static final byte B = 0;
  public static final byte C = 1;
  public static final byte D = 0;
  public static final byte E = 1;
  public static final byte F = 0;
  public static final byte G = 1;
  public static final byte H = 2;
  public static final byte I = 3;
  public static final byte J = 4;
  public static final byte K = 5;
  public static final byte L = 6;
  public static final byte M = -1;
  public static final byte N = 18;
  public static final byte O = 66;
  public static final byte P = 34;
  private byte Q = 66;
  private k R;
  private k S;
  private boolean T = false;
  private boolean U = true;
  private byte V = 1;
  private long W = 9223372036854775807L;
  private d X;
  private zb Y;
  private tc Z;
  private zb ab;
  private tc bb;
  private byte cb;
  private a.f.d.a.z db;
  private fc eb;
  private double fb = 20.0D;
  private boolean gb = false;
  private boolean hb = false;
  private a.f.vc ib;
  private boolean jb = false;
  private boolean kb = false;
  private boolean lb = false;
  public static int mb;
  
  public byte a()
  {
    return this.Q;
  }
  
  public void b(byte paramByte)
  {
    this.Q = paramByte;
  }
  
  public boolean s()
  {
    return this.T;
  }
  
  public void h(boolean paramBoolean)
  {
    this.T = paramBoolean;
  }
  
  public byte t()
  {
    return this.V;
  }
  
  public void c(byte paramByte)
  {
    if (f.o == 0) {}
    switch (paramByte)
    {
    case 0: 
    case 1: 
      this.V = paramByte;
      d(J());
      if (f.n == 0) {
        break;
      }
    default: 
      throw new IllegalArgumentException("Invalid policy: " + paramByte);
    }
  }
  
  public long u()
  {
    return this.W;
  }
  
  public void a(long paramLong)
  {
    this.W = paramLong;
  }
  
  public boolean v()
  {
    return this.U;
  }
  
  public void i(boolean paramBoolean)
  {
    this.U = paramBoolean;
  }
  
  public e()
  {
    f(false);
    b(false);
    e(false);
    d(false);
    this.cb = 1;
    d locald = I();
    this.ib = locald.b();
    this.bb = locald.A();
    this.ab = locald.z();
    b(new a.f.d.a.b());
    a(new b());
    cb localcb = new cb();
    localcb.a(false);
    j(localcb);
  }
  
  public boolean w()
  {
    return this.kb;
  }
  
  public void j(boolean paramBoolean)
  {
    this.kb = paramBoolean;
  }
  
  public boolean x()
  {
    return this.jb;
  }
  
  public void k(boolean paramBoolean)
  {
    this.jb = paramBoolean;
  }
  
  public void l(boolean paramBoolean)
  {
    U().c(paramBoolean);
  }
  
  public boolean y()
  {
    return U().h();
  }
  
  public void m(boolean paramBoolean)
  {
    int j = f.o;
    int i = f.n;
    this.gb = paramBoolean;
    if (j == 0)
    {
      if (!this.gb)
      {
        if (j != 0) {
          break label130;
        }
        if (!this.hb) {}
      }
      else
      {
        d(this.ib);
      }
    }
    else
    {
      a.f.vc localvc = b();
      if (j == 0)
      {
        if ((localvc instanceof pc))
        {
          ((pc)localvc).g(this.gb);
          ((pc)localvc).d(this.gb);
          ((pc)localvc).f(this.hb);
        }
      }
      else
      {
        if (j != 0) {
          break label126;
        }
        if (i == 0) {
          break label115;
        }
      }
      throw new IllegalStateException("No LabelLayoutTranslator registered");
      label115:
      if (j != 0) {
        break label131;
      }
      c(true);
      if (i == 0) {
        label126:
        return;
      }
    }
    label130:
    label131:
    c(false);
  }
  
  public boolean z()
  {
    int i = f.o;
    a.f.vc localvc = b();
    if (i == 0) {
      if ((localvc instanceof pc))
      {
        if ((i != 0) || (((pc)localvc).i())) {
          if (i != 0) {}
        }
        return ((pc)localvc).f();
      }
    }
    if (i == 0) {
      if (this.gb) {
        throw new IllegalStateException("No LabelLayoutTranslator registered");
      }
    }
    return false;
  }
  
  public void n(boolean paramBoolean)
  {
    this.hb = paramBoolean;
    m(this.gb);
  }
  
  public boolean A()
  {
    int i = f.o;
    a.f.vc localvc = b();
    if (i == 0) {
      if ((localvc instanceof pc)) {
        return ((pc)localvc).h();
      }
    }
    if (i == 0) {
      if (this.hb) {
        throw new IllegalStateException("No LabelLayoutTranslator registered");
      }
    }
    return false;
  }
  
  public void a(double paramDouble)
  {
    this.fb = paramDouble;
  }
  
  public double B()
  {
    return this.fb;
  }
  
  public void b(double paramDouble)
  {
    G().a(paramDouble);
  }
  
  public double C()
  {
    return G().b();
  }
  
  public void c(double paramDouble)
  {
    G().b(paramDouble);
  }
  
  public double D()
  {
    return G().c();
  }
  
  public void d(double paramDouble)
  {
    G().c(paramDouble);
  }
  
  public double F()
  {
    return G().d();
  }
  
  protected r G()
  {
    v localv = I().F();
    if ((f.o != 0) || ((localv instanceof r))) {
      return (r)localv;
    }
    throw new IllegalStateException();
  }
  
  protected d H()
  {
    return new d();
  }
  
  public d I()
  {
    if (f.o == 0) {
      if (this.X == null) {
        this.X = H();
      }
    }
    return this.X;
  }
  
  public void d(byte paramByte)
  {
    int i = f.o;
    Object localObject = null;
    ob localob = null;
    switch (paramByte)
    {
    case 0: 
      localob = new ob();
      localob.a((byte)0);
      localObject = localob;
      break;
    case 1: 
      localObject = new pb();
      break;
    case 2: 
      localob = new ob();
      localob.a((byte)2);
      localObject = localob;
      break;
    case 3: 
      localob = new ob();
      localob.a((byte)1);
      localObject = localob;
      break;
    case 4: 
      localObject = new p();
      this.X.a("y.layout.hierarchic.incremental.HierarchicLayouter.considerGroupNodeEdges", Boolean.FALSE);
      break;
    case 5: 
      a(new n());
      i(false);
      return;
    case 6: 
      a(new ab());
      i(false);
      return;
    default: 
      throw new IllegalArgumentException("Unknown strategy: " + paramByte);
    }
    if (i == 0) {
      if (this.V == 0)
      {
        i locali = new i((zb)localObject);
        if (i != 0) {
          break label241;
        }
        a(locali);
        if (f.n == 0) {
          return;
        }
      }
    }
    label241:
    a(new dc((zb)localObject));
  }
  
  public byte J()
  {
    int i = f.o;
    Object localObject = M();
    if (i == 0) {
      if ((localObject instanceof dc)) {
        localObject = ((dc)localObject).a();
      }
    }
    if (i == 0) {
      if ((localObject instanceof i)) {
        localObject = ((i)localObject).a();
      }
    }
    if (i == 0) {
      if ((localObject instanceof hc)) {
        localObject = ((hc)localObject).a();
      }
    }
    if (i == 0) {
      if ((localObject instanceof ob))
      {
        ob localob = (ob)localObject;
        if (i == 0) {
          switch (localob.a())
          {
          case 0: 
            return 0;
          case 1: 
            return 3;
          case 2: 
            return 2;
          }
        }
        if (i != 0) {
          break label186;
        }
        if (f.n == 0) {
          break label185;
        }
      }
    }
    if (i == 0) {
      if ((localObject instanceof pb)) {
        return 1;
      }
    }
    if (i == 0) {
      if ((localObject instanceof n)) {
        return 5;
      }
    }
    if (i == 0) {
      if ((localObject instanceof ab)) {
        return 6;
      }
    }
    if (i == 0) {
      if ((localObject instanceof p)) {
        return 4;
      }
    }
    label185:
    label186:
    return -1;
  }
  
  public boolean b(a.f.o paramo)
  {
    return I().b(paramo);
  }
  
  private void e(a.f.o paramo)
  {
    int m = f.o;
    int k = f.n;
    k localk = paramo.c(A);
    if (localk != null)
    {
      x localx = paramo.B();
      HashMap localHashMap = new HashMap();
      a.c.z localz = new a.c.z();
      int i = 0;
      w localw = paramo.v();
      Object localObject1;
      Object localObject2;
      Object localObject3;
      label200:
      label202:
      label224:
      do
      {
        do
        {
          if (!localw.e()) {
            break;
          }
          localObject1 = localw.d();
          localObject2 = (a.f.d.a.vc)localk.get(localObject1);
          if (k != 0) {
            break label448;
          }
          if (localObject2 != null)
          {
            if (m == 0) {
              if (!localHashMap.containsKey(localObject2))
              {
                localz.add(localObject2);
                localObject3 = new ld.b_(0, !((a.f.d.a.vc)localObject2).a());
                localx.a(localObject1, localObject3);
                localHashMap.put(localObject2, localObject3);
                if (m != 0) {
                  break label202;
                }
                if (k == 0) {
                  break label200;
                }
              }
            }
            localObject3 = (ld.b_)localHashMap.get(localObject2);
            localx.a(localObject1, localObject3);
            if (m == 0) {
              if (i == 0) {
                if (m != 0) {
                  break label224;
                }
              }
            }
            i = !((a.f.d.a.vc)localObject2).a() ? 1 : 0;
          }
          localw.f();
        } while (k == 0);
      } while (m != 0);
      if (m == 0)
      {
        if (i != 0) {
          localz.a(new b_(null));
        }
      }
      else
      {
        int j = 0;
        localObject1 = localz.h();
        do
        {
          if (!((y)localObject1).e()) {
            break;
          }
          localObject2 = (ld.b_)localHashMap.get(((y)localObject1).j());
          ((ld.b_)localObject2).a(j++);
          ((y)localObject1).f();
          if ((m == 0) && (k != 0)) {
            break label353;
          }
        } while (k == 0);
        if (m != 0) {
          break label455;
        }
        ld.a(paramo, localx, 5, 2);
        label353:
        localObject1 = paramo.v();
        do
        {
          if (!((w)localObject1).e()) {
            break;
          }
          localObject2 = ((w)localObject1).d();
          localObject3 = (a.f.d.a.vc)localk.get(localObject2);
          if (k != 0) {
            return;
          }
          if ((m != 0) || (localObject3 != null))
          {
            ld.b_ localb_ = (ld.b_)localx.get(localObject2);
            ((a.f.d.a.vc)localObject3).a(new Integer(localb_.a()));
          }
          ((w)localObject1).f();
        } while (k == 0);
      }
      label448:
      if (m == 0) {
        label455:
        paramo.a(localx);
      }
    }
  }
  
  public void a(a.f.o paramo)
  {
    int j = f.o;
    int i = f.n;
    if (j == 0)
    {
      if (paramo == null) {
        return;
      }
      e(paramo);
    }
    d locald = I();
    a(paramo, locald);
    k localk1 = paramo.c(d.F);
    Object localObject1;
    if (j == 0)
    {
      if (localk1 == null)
      {
        localObject1 = a.i.q.a(U());
        if (j != 0) {
          break label102;
        }
        if (i == 0) {}
      }
      else
      {
        paramo.j(d.F);
      }
    }
    else {
      localObject1 = new c_(localk1, U());
    }
    paramo.a(d.F, (k)localObject1);
    label102:
    k localk2 = paramo.c(d.G);
    if (j == 0)
    {
      if (localk2 == null)
      {
        localObject1 = a.i.q.a(W());
        if (j != 0) {
          break label171;
        }
        if (i == 0) {}
      }
      else
      {
        paramo.j(d.G);
      }
    }
    else {
      localObject1 = new c_(localk2, W());
    }
    paramo.a(d.G, (k)localObject1);
    label171:
    k localk3 = null;
    if (S() != 0)
    {
      localk3 = paramo.c(x);
      paramo.j(x);
    }
    try
    {
      locald.a(paramo);
    }
    finally
    {
      paramo.j(d.F);
      if (j == 0)
      {
        if (localk1 != null) {
          paramo.a(d.F, localk1);
        }
        if (j == 0) {
          paramo.j(d.G);
        }
      }
      else
      {
        if (localk2 == null) {
          break label268;
        }
      }
      paramo.a(d.G, localk2);
      label268:
      if (j == 0) {
        if ((S() != 0) && (localk3 != null)) {
          paramo.a(x, localk3);
        }
      }
      b(paramo, locald);
    }
  }
  
  protected int K()
  {
    a.f.vc localvc = h();
    if (f.o == 0) {
      if ((localvc instanceof cb))
      {
        cb localcb = (cb)localvc;
        return localcb.c();
      }
    }
    return 4;
  }
  
  protected void a(a.f.o paramo, d paramd)
  {
    int k = f.o;
    int j = f.n;
    if (k == 0) {
      if (paramd.D() == null)
      {
        this.lb = true;
        if (((k == 0) && (paramo.c(bd.a) != null)) || ((k != 0) || ((paramo.c(ad.q) != null) || (paramo.c(ad.r) != null))))
        {
          g localg = new g();
          localg.a(i());
          localg.a(K());
          paramd.a(localg);
        }
      }
    }
    if (k == 0)
    {
      paramd.j(h());
      if (this.jb)
      {
        this.R = paramo.c(ed.c);
        paramo.j(ed.c);
        this.S = paramo.c(ed.d);
        paramo.j(ed.d);
      }
    }
    paramd.a("y.layout.hierarchic.incremental.HierarchicLayouter.automaticEdgeGroupingEnabled", x() ? Boolean.TRUE : Boolean.FALSE);
    paramd.a("y.layout.hierarchic.incremental.HierarchicLayouter.backloopRoutingEnabled", w() ? Boolean.TRUE : Boolean.FALSE);
    paramd.a(u());
    paramd.a("DefaultEdgeRouter.defaultMinLayerDistance", new Double(this.fb));
    paramd.a("DefaultEdgeRouter.minimumEdgeDistance", new Double(U().d()));
    paramd.a("y.layout.hierarchic.incremental.HierarchicLayouter.RecursiveGroupLayerer.enabled", !v() ? Boolean.FALSE : Boolean.TRUE);
    if (k == 0)
    {
      if (!(paramd.a("y.layout.hierarchic.incremental.HierarchicLayouter.RecursiveGroupLayerer.interEdgePromotionEnabled") instanceof Boolean)) {
        paramd.a("y.layout.hierarchic.incremental.HierarchicLayouter.RecursiveGroupLayerer.interEdgePromotionEnabled", v() ? Boolean.TRUE : Boolean.FALSE);
      }
      if (k != 0) {}
    }
    else
    {
      if (!(paramd.a("y.layout.hierarchic.incremental.HierarchicLayouter.considerGroupNodeEdges") instanceof Boolean)) {
        paramd.a("y.layout.hierarchic.incremental.HierarchicLayouter.considerGroupNodeEdges", Boolean.TRUE);
      }
      paramd.a("y.layout.hierarchic.incremental.HierarchicLayouter.RecursiveGroupLayerer.alignment", new Byte(a()));
    }
    paramd.a("y.layout.hierarchic.incremental.HierarchicLayouter.RecursiveGroupLayerer.compactionEnabled", s() ? Boolean.TRUE : Boolean.FALSE);
    paramd.a("y.layout.hierarchic.incremental.HierarchicLayouter.useAspectRatioLayerer", this.V == 0 ? Boolean.TRUE : Boolean.FALSE);
    if (k == 0) {}
    int i = (kc.e(paramo)) || (paramo.c(xb.a) != null) ? 1 : 0;
    if (k == 0) {
      switch (S())
      {
      case 1: 
      default: 
        if ((k != 0) || (i != 0)) {
          if (k == 0)
          {
            if (!(M() instanceof a.f.d.a.o)) {
              paramd.a(new a.f.d.a.o(M()));
            }
          }
          else
          {
            if (k != 0) {
              break label524;
            }
            if (j == 0) {
              break label509;
            }
          }
        }
        paramd.a(M());
        paramd.a(O());
        if (k == 0) {
          if (j == 0) {
            label524:
            return;
          }
        }
        break;
      case 0: 
        label509:
        paramd.a(Q());
      }
    }
    paramd.a(R());
  }
  
  protected void b(a.f.o paramo, d paramd)
  {
    int i = f.o;
    if (i == 0) {
      if (this.lb) {
        paramd.a(null);
      }
    }
    if (i == 0)
    {
      if (this.R != null)
      {
        paramo.a(ed.c, this.R);
        this.R = null;
      }
      if (i != 0) {}
    }
    else
    {
      if (this.S == null) {
        return;
      }
      paramo.a(ed.d, this.S);
    }
    this.S = null;
  }
  
  public a.f.d.a.ob L()
  {
    return I().V();
  }
  
  public sc f(a.f.o paramo)
  {
    return I().a(paramo);
  }
  
  public xb a(a.c.q paramq)
  {
    return I().b(paramq);
  }
  
  public zb M()
  {
    return this.ab;
  }
  
  public void a(zb paramzb)
  {
    if (paramzb == null) {
      throw new NullPointerException();
    }
    this.ab = paramzb;
  }
  
  public tc O()
  {
    return this.bb;
  }
  
  public void a(tc paramtc)
  {
    if (paramtc == null) {
      throw new NullPointerException();
    }
    this.bb = paramtc;
  }
  
  public gc P()
  {
    return I().B();
  }
  
  public void a(gc paramgc)
  {
    if (paramgc == null) {
      throw new NullPointerException();
    }
    I().a(paramgc);
  }
  
  public zb Q()
  {
    if (f.o == 0) {
      if (this.Y == null) {
        this.Y = new n();
      }
    }
    return this.Y;
  }
  
  public void b(zb paramzb)
  {
    if (paramzb == null) {
      throw new NullPointerException();
    }
    this.Y = paramzb;
  }
  
  public tc R()
  {
    if (f.o == 0) {
      if (this.Z == null) {
        this.Z = new h();
      }
    }
    return this.Z;
  }
  
  public void b(tc paramtc)
  {
    if (paramtc == null) {
      throw new NullPointerException();
    }
    this.Z = paramtc;
  }
  
  public byte S()
  {
    return this.cb;
  }
  
  public void e(byte paramByte)
  {
    if ((f.o != 0) || ((paramByte != 1) && (paramByte != 0))) {
      throw new IllegalArgumentException();
    }
    this.cb = paramByte;
  }
  
  protected a.f.d.a.z T()
  {
    return new a.f.d.a.z();
  }
  
  public a.f.d.a.z U()
  {
    if (f.o == 0) {
      if (this.db == null) {
        this.db = T();
      }
    }
    return this.db;
  }
  
  public void a(a.f.d.a.z paramz)
  {
    if (paramz == null) {
      throw new NullPointerException();
    }
    this.db = paramz;
  }
  
  protected fc V()
  {
    return new fc();
  }
  
  public fc W()
  {
    if (f.o == 0) {
      if (this.eb == null) {
        this.eb = V();
      }
    }
    return this.eb;
  }
  
  public void a(fc paramfc)
  {
    if (paramfc == null) {
      throw new NullPointerException();
    }
    this.eb = paramfc;
  }
  
  private static class b_
    implements Comparator, l.j_
  {
    private b_() {}
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      int i = f.o;
      a.f.d.a.vc localvc1 = (a.f.d.a.vc)paramObject1;
      a.f.d.a.vc localvc2 = (a.f.d.a.vc)paramObject2;
      if (i == 0) {
        if (localvc1.a())
        {
          if (i == 0) {
            if (localvc2.a()) {
              return 0;
            }
          }
          return 1;
        }
      }
      if (i == 0) {
        if (localvc2.a()) {
          return -1;
        }
      }
      return localvc1.compareTo(paramObject2);
    }
    
    b_(e.0 param0)
    {
      this();
    }
  }
  
  private static final class c_
    extends a.i.p
  {
    private final k c;
    private final Object d;
    
    public c_(k paramk, Object paramObject)
    {
      this.c = paramk;
      this.d = paramObject;
    }
    
    public Object get(Object paramObject)
    {
      Object localObject = this.c.get(paramObject);
      if (f.o == 0) {}
      return localObject == null ? this.d : localObject;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.d.e

 * JD-Core Version:    0.7.0.1

 */